package 剑指offer;

/**
 * Created by lenovo】 on 2017/3/19.
 */
public class FindGreatestSumOfSubArray {
    public int FindGreatestSumOfSubArray(int[] array) {
        int len = array.length;
        int current = array[0];
        int temp = 0;
        for (int i = 0; i < len; i++) {
            for (int j = i; j < len; j++) {
                temp = temp + array[j];
                if (current < temp) {
                    current = temp;
                }
            }
            temp = 0;
        }

        return current;
    }
}
